// 统一管理项目接口地址
import axios from "@/request/request";
import qs from 'qs';

// 获取精品推荐的数据
export const JingpinAPI = () => axios.get("/products/recommend");

// 获取热门的数据
export const RemenAPI = () => axios.get("/products/hot");

// 发送短信验证码
export const SendSMSAPI = (params) => axios.post("/sendSMS", qs.stringify(params));

// 登录请求
export const PhoneLoginAPI = (params) => axios.post("/phoneRegin", qs.stringify(params));

// 081MhCml2FR6o94RwHol2BvVu81MhCma

// 微信扫码登录
export const WeiXinLoginAPI = (params) => axios.post("/wechatUsers/PCLogin", qs.stringify(params));

// 手机号关联微信登录
export const BinddingAPI = (params) => axios.post("/wechatUsers/binding", qs.stringify(params));

// 获取用户信息
export const UserProfilesAPI = () => axios.get("/shop/userProfiles");

// 请求详情页的数据
export const GoodDetailsAPI = (id) => axios.get(`/products/${id}`);

// 加入购物车
export const AddToCartAPI = (params) => axios.post("/shop/carts/add", qs.stringify(params));

// 全部商品
export const GoodsSearchAPI = (params) => axios.get("/products", { params });//params:params

// 查看购物车
export const CartDataAPI = () => axios.get("/shop/carts");

// 删除
export const CarDelAPI = (params) => axios.delete(`/shop/carts?productIds=${params.id}`);